/**
 * @Author      : maolin
 * @Date        : 2021/4/6
 * @Version     : 1.0
 * @Description :
 **/
export function getDemandNum({unitList, sellUnit, sellNum, mainUnit}) {
  if (sellUnit == mainUnit) {
    return sellNum;
  }
  let ratio = 0;
  if (unitList) {
    for (let i in unitList) {
      if (unitList[i].fromId == sellUnit) {
        ratio = unitList[i].ratio;
        break;
      }
    }
  }
  if (ratio) {
    return sellNum * ratio;
  }
  return 0;
}
